<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <button>按钮</button>
    <script>
        class star {
            constructor(mingzi, nianling) {
                this.name = mingzi;
                this.age = nianling;
            }
            sing() {
                return this.name + `今年${this.age}岁了`;
            }
        }
        const ldh = new star('刘德华', 60);
        const zxy = new star('张学友', 61);
        // console.log(ldh);
        ldh.sing('冰雨')

        class son extends star {
            constructor(x, y, z) {
                super(x, y);
                this.genDer = z;
                this.btn = document.querySelector('button');
                this.btn.addEventListener('click', sing())
            }
            sing(chang) {
                // console.log(this.super.sing());
                console.log(`${super.sing()} 会唱${chang} 性别：${this.genDer}`);
            }

        }
        const WYF = new son('无E烦', 3, '女')
        WYF.sing('大碗宽面')

    </script>
</body>

</html>